<template>
    <div @click="formatName">
        {{ name }}
    </div>
    {{ subName }}
    <hr />
    <input v-model="username" />
    <div @click="formatUserName">
        {{ username }}
    </div>
    {{ subUsername }}
</template>

<script>
import { ref, computed } from 'vue'

export default {
    data() {
        return {
            name: '小明'
        }
    },
    methods: {
        formatName() {
            this.name = `来自北京的${this.name}`
        }
    },
    computed: {
        subName() {
            console.log(343)
            return this.name + '####'
        }
    },
    setup() {}
}
</script>

<style></style>
